import request from '../utils/request';
import { createTheURL } from '../utils/utils';
import API from '../config/api';


// Service的示例写法
export async function getTestData(params) {
  return request(createTheURL(API.testAPI, 'LIST'), {
    method: 'GET',
    body: params,
  });
}

export async function addTestData(params) {
  return request(createTheURL(API.testAPI, 'ADD'), {
    method: 'POST',
    body: params,
  });
}

export async function removeTestData(params) {
  return request(createTheURL(API.testAPI, 'REMOVE'), {
    method: 'DELETE',
    body: params,
  });
}

export async function updateTestData(params) {
  return request(createTheURL(API.pageAPI, 'UPDATE'), {
    method: 'POST',
    body: params,
  });
}
